import request from '@/utils/request'


// 查询所有地址库列树形表
export function getAllList() {
    return request({
        url: '/laiqianle/address/getAllList',
        method: 'get'
    })
}

// 获取分组地址库信息
export function getGroupInfo(list) {
    return request({
        url: '/laiqianle/address/getGroupList/' + list,
        method: 'get'
    })
}

// 查询地址库列表
export function listAddressLibrary(query) {
    return request({
        url: '/laiqianle/address/list',
        method: 'get',
        params: query
    })
}

// 查询地址库详细
export function getAddressLibrary(id) {
    return request({
        url: '/laiqianle/address/' + id,
        method: 'get'
    })
}

// 查询下级地址库详细
export function getSubordinateAddressLibrary(parentId) {
    return request({
        url: '/laiqianle/address/getSubordinateList/' + parentId,
        method: 'get'
    })
}

// 新增地址库
export function addAddressLibrary(data) {
    return request({
        url: '/laiqianle/address',
        method: 'post',
        data: data
    })
}

// 修改地址库
export function updateAddressLibrary(data) {
    return request({
        url: '/laiqianle/addressLibrary',
        method: 'put',
        data: data
    })
}

// 删除地址库
export function delAddressLibrary(id) {
    return request({
        url: '/laiqianle/address/' + id,
        method: 'delete'
    })
}

// 导出地址库
export function exportAddressLibrary(query) {
    return request({
        url: '/laiqianle/address/export',
        method: 'get',
        params: query
    })
}


// 下载导入模板
export function importTemplateApi() {
    return request({
        url: '/laiqianle/address/importTemplate',
        method: 'get'
    })
}